clear all

** Set working directory: please set your own
/*
cd "~/Dropbox/sanctions_replication/"
*/
** Open dataset
use data/survey_clean.dta, clear

* Analyses
* Physical sanctions, sociodemographics (Madrid is ref category for regions)
regr intent_phis_vox_num female_dummy age_calculated college spanish  ///
canarias murcia andalucia balears valencia cataluna extremadura castilla_mancha ///
castilla_leon aragon rioja navarra pais_vasco cantabria asturias galicia if ccaa != "NA", r
est store vox_phis_sociodem_ccaa

* Verbal sanctions, sociodemographics (Madrid is ref category for regions)
regr intent_verb_vox_num female_dummy age_calculated college spanish  ///
canarias murcia andalucia balears valencia cataluna extremadura castilla_mancha ///
castilla_leon aragon rioja navarra pais_vasco cantabria asturias galicia if ccaa != "NA", r
est store vox_verbal_sociodem_ccaa

* Insult, sociodemographics (Madrid is ref category for regions)
regr intent_insult_vox_num female_dummy age_calculated college spanish  ///
canarias murcia andalucia balears valencia cataluna extremadura castilla_mancha ///
castilla_leon aragon rioja navarra pais_vasco cantabria asturias galicia if ccaa != "NA", r
est store vox_insult_sociodem_ccaa

* PCA direct sanctions, sociodemographics (Madrid is ref category for regions)
regr pca_direct female_dummy age_calculated college spanish  ///
canarias murcia andalucia balears valencia cataluna extremadura castilla_mancha ///
castilla_leon aragon rioja navarra pais_vasco cantabria asturias galicia if ccaa != "NA", r
est store pca_direct_sociodem_ccaa

* Deny help, sociodemographics (Madrid is ref category for regions)
regr intent_deny_vox_num female_dummy age_calculated college spanish  ///
canarias murcia andalucia balears valencia cataluna extremadura castilla_mancha ///
castilla_leon aragon rioja navarra pais_vasco cantabria asturias galicia if ccaa != "NA", r
est store vox_deny_sociodem_ccaa

* Avoid Interaction, sociodemographics (Madrid is ref category for regions)
regr intent_avoid_vox_num female_dummy age_calculated college spanish  ///
canarias murcia andalucia balears valencia cataluna extremadura castilla_mancha ///
castilla_leon aragon rioja navarra pais_vasco cantabria asturias galicia if ccaa != "NA", r
est store vox_avoid_sociodem_ccaa

* Gossip, sociodemographics (Madrid is ref category for regions)
regr intent_gossip_vox_num female_dummy age_calculated college spanish  ///
canarias murcia andalucia balears valencia cataluna extremadura castilla_mancha ///
castilla_leon aragon rioja navarra pais_vasco cantabria asturias galicia if ccaa != "NA", r
est store vox_gossip_sociodem_ccaa

* PCA indirect sanctions, sociodemographics (Madrid is ref category for regions)
regr pca_indirect female_dummy age_calculated college spanish  ///
canarias murcia andalucia balears valencia cataluna extremadura castilla_mancha ///
castilla_leon aragon rioja navarra pais_vasco cantabria asturias galicia if ccaa != "NA", r
est store pca_indirect_sociodem_ccaa

* PCA all sanctions, sociodemographics (Madrid is ref category for regions)
regr pca_all female_dummy age_calculated college spanish  ///
canarias murcia andalucia balears valencia cataluna extremadura castilla_mancha ///
castilla_leon aragon rioja navarra pais_vasco cantabria asturias galicia if ccaa != "NA", r
est store pca_all_sociodem_ccaa

* Make table
esttab vox_phis_sociodem_ccaa vox_verbal_sociodem_ccaa vox_insult_sociodem_ccaa  ///
 pca_direct_sociodem_ccaa  vox_gossip_sociodem_ccaa vox_deny_sociodem_ccaa  vox_avoid_sociodem_ccaa  ///
pca_indirect_sociodem_ccaa   pca_all_sociodem_ccaa  using tables/tableb8.tex, tex nonumber ///
mtitles("Physical" "Physical" "Verbal" "Verbal" "Insult" "Insult"  "Dir sanct (PCA)" "Dir sanct (PCA)" "Gossip" "Gossip" "Deny help" "Deny help" "Avoid interact" "Avoid interact" "Ind sanct (PCA)" "Ind sanct (PCA)" "All sanctions (PCA)" "All sanctions (PCA)" ) ///
coeflabels(left_right_self "Left-right self placement" ///
female_dummy "Female (dummy)" age_calculated "Age" college "College" spanish "Spanish" ///
pol_interest "Political interest" canarias "Canarias" murcia "Murcia" ///
andalucia "Andalucia" balears "Balears" valencia "Valencia" cataluna "Catalunya" ///
extremadura "Extremadura" castilla_mancha "Castilla La Mancha" castilla_leon "Castilla y Leon" ///
aragon "Aragon" rioja "Rioja" navarra "Navarra" pais_vasco "Basque country" ///
cantabria "Cantabria" asturias "Asturias" galicia "Galicia"  happy_vox_num "Happiness" ///
anger_vox_num "Anger" disgust_vox_num "Disgust" fear_vox_num "Fear" sad_vox_num "Sadness" vox_vote_ccaa "Vox vote in Region" _cons "Constant") se ///
replace addnotes("Standard errors are robust")
